package com.mvu.banana.common.server;

import java.util.HashMap;

/**
 * Interface description...
 *
 * @author mvu
 */
public class ServletFactory {
  private static ServletFactory instance;
  private static HashMap<String, AJAXServlet> registry = new HashMap<String, AJAXServlet>();

  static {
    instance = new ServletFactory();
  }

  public static ServletFactory instance(){
    return instance;
  }

  public static void register(Class widgetClass, AJAXServlet valueProvider){
    registry.put(widgetClass.getName(), valueProvider);
  }

  public AJAXServlet create(String className){
    return registry.get(className);
  }
}
